package com.hxzy.shop.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 中间表商品-砍价活动
 *
 * @TableName full_haggle_drug
 */
@TableName(value = "full_haggle_drug")
@Data
@ApiModel("砍价商品")
@Accessors(chain = true)
public class FullHaggleDrug implements Serializable {
    /**
     * 砍价商品ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @TableField(value = "drug_id")
    private Long drugId;

    /**
     * 砍价活动id
     */
    @ApiModelProperty(value = "砍价活动id")
    @TableField(value = "haggle_id")
    private Long haggleId;

    /**
     * 商品原始价格
     */

    @ApiModelProperty(value = "商品原始价格")
    @TableField(value = "drug_price")
    private BigDecimal drugPrice;

    /**
     * 商户id
     */
    @ApiModelProperty(value = "..", hidden = true)
    @TableField(value = "merchant_id")
    private Long merchantId;

    /**
     * 首刀金额
     */
    @ApiModelProperty(value = "首刀金额")
    @TableField(value = "first_price")
    private BigDecimal firstPrice;

    /**
     * 商品活动库存
     */
    @ApiModelProperty(value = "商品活动库存")
    @TableField(value = "drug_num")
    private Integer drugNum;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "..", hidden = true)
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 状态（0：暂停 ，1：正常 2：已结束）
     */
    @ApiModelProperty(value = "状态（0：结束1：砍价中2：未开始s）")
    @TableField(value = "state")
    private Integer state;

    /**
     * 删除（0：删除 1：未删除）
     */
    @ApiModelProperty(value = "删除（0：删除 1：未删除）")
    @TableField(value = "is_delete", fill = FieldFill.INSERT)
    private Integer isDelete;

    /**
     * 商品底价
     */
    @ApiModelProperty(value = "商品底价")
    @TableField(value = "floor_price")
    private BigDecimal floorPrice;

    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空")
    @ApiModelProperty(value = "商品名称")
    @TableField(value = "drug_name")
    private String drugName;

    /**
     * 商品详情图
     */
    @NotBlank(message = "商品详情图不能为空")
    @ApiModelProperty(value = "商品详情图")
    @TableField(value = "tabular_chart")
    private String tabularChart;

    /**
     * 商品活动价格
     */
    @Min(value = 1,message = "商品活动价格不能为空")
    @ApiModelProperty(value = "商品活动价格")
    @TableField(value = "drug_activity_price")
    private BigDecimal drugActivityPrice;

    @ApiModelProperty("砍价商品结束时间")
    @TableField(value = "valid_end_time")
    private Date validEndTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}